//
//  WAGoodsListViewModel.m
//  WalkiOS
//
//  Created by luqiuan on 2019/10/23.
//  Copyright © 2019 Chenmuzhou. All rights reserved.
//

#import "WAGoodsListViewModel.h"
#import "MJExtension.h"

@implementation WAGoodsListViewModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.dataList = [NSArray new];
        [self bindModel];
    }
    return self;
}

- (void)bindModel{
    self.requestCommond = [[RACCommand alloc] initWithSignalBlock:^RACSignal * _Nonnull(id  _Nullable input) {
        return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber>  _Nonnull subscriber) {
//            NSString *url = @"http://v.juhe.cn/toutiao/index?type=&key=d9088e8d2a8a3c244f114da8e3235d81";
//            [[[NetworkTool sharedManager] rac_GET:url parameters:nil modelClass:nil] subscribeNext:^(RACTuple *tuple) {
//                NSLog(@"");
//
//                NSDictionary *dict = tuple.last;
//                dict = dict[@"result"];
//                NSArray *arr = [WAGoodListModel mj_objectArrayWithKeyValuesArray:dict[@"data"]];
//
//                [subscriber sendNext:arr];
//                [subscriber sendCompleted];
//            } error:^(NSError * _Nullable error) {
//
//            } completed:^{
//
//            }];
            return nil;
        }];
    }];
}
@end
